public class Message {
    private String text;
    private String recipient;
    private String sender;
    public Message(){
    }

    public Message(String text, String recipient, String sender) {
        this.text = text;
        this.recipient = recipient;
        this.sender = sender;
    }

    @Override
    public String toString(){
        return "From:"+this.sender+"\nTo:"+this.recipient+"\n"+text;
    }
    public void append(String newtext)
    {
        this.text+="\n"+newtext;
    }

    /**
     * 获取
     * @return text
     */
    public String getText() {
        return text;
    }

    /**
     * 设置
     * @param text
     */
    public void setText(String text) {
        this.text = text;
    }

    /**
     * 获取
     * @return recipient
     */
    public String getRecipient() {
        return recipient;
    }

    /**
     * 设置
     * @param recipient
     */
    public void setRecipient(String recipient) {
        this.recipient = recipient;
    }

    /**
     * 获取
     * @return sender
     */
    public String getSender() {
        return sender;
    }

    /**
     * 设置
     * @param sender
     */
    public void setSender(String sender) {
        this.sender = sender;
    }
}
